import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import { resolve } from 'path'

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],
  resolve: {
    extensions: ['.ts', '.mjs'],
    alias: {
      //这里猜测应该是一个map，key为别名，value为你要别名的路径
      "@": resolve(__dirname, "src"),
      "coms": resolve(__dirname, "src/components"),
    },
  },
  server: {
    port: 3001,
  }
})
